/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jims.api.v1.controller.sync;

import com.baomidou.kisso.my.controller.BaseController;
import com.jims.master.common.data.Message;
import com.jims.master.common.utils.Encodes;
import com.jims.master.common.utils.SecurityUtil;
import com.jims.master.modules.sync.entity.Diagnosis;
import com.jims.master.modules.sync.entity.SummaryLeaveHospital;
import com.jims.master.modules.sync.service.DiagnosisService;
import com.jims.master.modules.sync.service.SummaryLeaveHospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 出院小结Controller
 * @author xueyx
 * @version 2017-11-21
 */
@RestController
@RequestMapping(value = "summaryLeaveHospital")
public class SummaryLeaveHospitalController extends BaseController {

	@Autowired
	private SummaryLeaveHospitalService summaryLeaveHospitalService;
    /***
     * 出院小结
     * @param visitId
     */
    @Autowired
    private DiagnosisService diagnosisService;

    @RequestMapping(value = "/V100/getInfo")
    public String getInfo(String visitId) {
        SummaryLeaveHospital summaryLeaveHospital = summaryLeaveHospitalService.getByVisitId(visitId);
        if(summaryLeaveHospital!=null){
//            List<Diagnosis> diagnosisInList= diagnosisService.findEmrDiagnosisList(summaryLeaveHospital.getId());
            summaryLeaveHospital.setOutSituation(Encodes.unescapeHtml(summaryLeaveHospital.getOutSituation()));
            summaryLeaveHospital.setOutOrders(Encodes.unescapeHtml(summaryLeaveHospital.getOutOrders()));
            summaryLeaveHospital.setTreatmentProcess(Encodes.unescapeHtml(summaryLeaveHospital.getTreatmentProcess()));
            summaryLeaveHospital.setTreatmentResults(Encodes.unescapeHtml(summaryLeaveHospital.getTreatmentResults()));
//            map.put("diagnosisInList", diagnosisInList);
        }
        Message mes = new Message();
        mes.setData(summaryLeaveHospital);
        return SecurityUtil.encryptMsgData(mes);
    }

}